<template>
  <div id="tmpl">
    <div class="title">
      <h3>{{infos.title}}</h3>
      <p>{{ infos.add_time | datefmt("YYYY-MM-DD") }}　　　{{infos.click}}次浏览</p>
    </div>
    <hr>
    <div class="content" v-html="infos.content">
    </div>

    <comment :id="id"></comment>
  </div>
</template>

<script>
  //  import { Toast } from 'mint-ui';
  import common from "../../kits/common"

  import comment from "../subcom/comment.vue"

  export default {
    components : {
      comment
    },
    data () {
      return {
        id: '',
        infos: {}
      }
    },
    methods: {
      getcontent() {
        var url = common.domianapi + "/api/getnew/" + this.$route.params.id;
        this.$http.get(url).then(function (info) {
          this.infos = info.body.message[0]
        })
      }
    },

    created () {
      this.id = this.$route.params.id;
      this.getcontent()
    }

  }
</script>

<style scoped>
  .title {
    margin-top: 70px;
  }

</style>
